<template>
	<view class="content">
		<view class="banner">
			<u-swiper :list="list1" @change="changeBanner" :loading="loading" :height="200" :current="bannerCurrent" @click="click" indicator="true"
				indicatorMode="dot"></u-swiper>
		</view>
		<view class="con">
			<view class="li">
				<view class="icon">
					<u-icon name="phone" size="26" color="#397fcb"></u-icon>
				</view>
				<view class="text">
					电话: {{list_data.mobile}}
				</view>
			</view>
			<view class="li">
				<view class="icon">
					<u-icon name="clock" size="26" color="#397fcb"></u-icon>
				</view>
				<view class="text">
					营业时间:{{list_data.start_time}} ~ {{list_data.end_time}}
				</view>
			</view>
			<view class="li">
				<view class="icon">
					<u-icon name="map" size="26" color="#397fcb"></u-icon>
				</view>
				<view class="text">
					地址: {{list_data.province}}市 {{list_data.city}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list1: [],
				loading:true,
				bannerCurrent: 0,
				list_data:[]
			}
		},
		methods: {
			changeBanner(e) {
				this.bannerCurrent = e.current
			},
			async loadBanner(){
				let that = this;
				that.http("applet_banner_index",{
					type:2
				}).then(res=>{
					if(res.ec == 200){
						
						let app_base = getApp().globalData.root_url;
						if(res.data.length != 0){
							that.loading = false;
							res.data.forEach(function(item,index){
								that.list1.push(app_base+item.img_file)
							})
						}
						
					}
					
				})
			},
			async loadAbout(){
				let that = this;
				that.http("applet_house_about").then(res=>{
					if(res.ec ==200){
						this.list_data = res.data
					}
				})
			}
		},
		onLoad() {
			
			this.loadAbout();
		},
		onShow() {
			this.loadBanner();
		}
	}
</script>

<style lang="scss">
	.con {
		display: flex;
		flex-direction: column;

		.li {
			display: flex;
			flex-direction: row;
			justify-content: center;
			align-items: center;
			width: 94%;
			margin: 0 auto;
			border-bottom: 1rpx solid #f5f5f5;

			.icon {
				width: 80rpx;
				height: 80rpx;
				display: flex;
				justify-content: center;
				align-items: center;
			}

			.text {
				flex: 1;
			}
		}

	}
</style>
